package com.itheima.mapper;

import com.itheima.pojo.Account;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountMapper {
    //新增
    @Insert("insert into account values (id,#{username},#{money})")
    void save(Account account);
    //更新
    @Update("update account set money=#{money} where id=#{id}")
    void update(Account account);
    //根据id查询
    @Select("select * from account where id=#{id}")
    Account findById(Integer id);
    //查询所有
    @Select("select * from account")
    List<Account> findAll();
}
